/**
 * 
 */
package cn.tonyqiu.wonuly.dao.ibatis;

import java.util.List;

import cn.tonyqiu.wonuly.dao.AccountDao;
import cn.tonyqiu.wonuly.model.Account;

/**
 * @author <a href="mailto:tony.qiu.smart@gmail.com">Tony Qiu</a>
 *
 */
public class AccountDaoiBatis extends GenericDaoiBatis<Account, Integer>
		implements AccountDao{
	
	public AccountDaoiBatis() {
		super(Account.class);
	}

	/* (non-Javadoc)
	 * @see cn.tonyqiu.wonuly.dao.AccountDao#getAccountsByUserId(int)
	 */
	@Override
	@SuppressWarnings("unchecked")
	public List<Account> getAccountsByUserId(int userId) {
		return getSqlMapClientTemplate().queryForList("getAccountsByUserId",userId);
	}

	/* (non-Javadoc)
	 * @see cn.tonyqiu.wonuly.dao.AccountDao#getAccountByAccountName(java.lang.String)
	 */
	@Override
	@SuppressWarnings("unchecked")
	public Account getAccountByAccountName(Account account) {
		return (Account)getSqlMapClientTemplate().queryForObject("getAccountByAccountName",account);
	}
	
	

}
